<?php

class Ehl_Controller_Admin_Action extends Ehl_Controller_Action
{

    public function init()
    {
        $this->_helper->layout()->setLayout("adminsimplelayout");
        
        $storage = Zend_Auth::getInstance()->getStorage()->read();
        if (intval($storage->idusers) > 0) {
            $currentUser = new Administration_Model_Users($storage->idusers);
        } else {
            $currentUser = null;
        }
        if ( is_null($currentUser) || $currentUser->getAdmin() != "1" ) {
       		$this->_redirect("/default/error/notadmin");
        }
    }
}

